package com.example.shopping.Order.mapper;


import com.example.shopping.Order.entity.Orders;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Order {
    //查询所有订单
    @Select("select * from orders")
    List<Orders> getOrderList();

    //添加订单
    @Insert("insert into orders(userid,productid,quantity,paymenttype,postage,payment,status)" +
            " value(#{userid},#{productid},#{quantity},#{paymenttype},#{postage},#{payment},#{status})")
    int OrderAdd(Orders orders);

    //修改订单状态
    @Update("update orders set status=#{status} where id=#{id}")
    int UpdateOrders(Orders orders);

    //删除订单
    @Delete("delete from orders where id=#{id}")
    int DeleteOrders(@Param("id") int id);
}
